<extend name="Layout:layout_list" />
<block name="head_after_block">
    <link href="__THEME__Plugin/jquery-audioplayer-1.0/jquery-audioplayer.css" rel="stylesheet" type="text/css"/>
</block>
<block name="body_content_block">
    <table id="main_grid" class="easyui-datagrid" data-url="{:AddonU('MusicMenu/get_musicmenu_list_json')}"></table>
    <div id="tb" style="padding:2px 5px;">
        <div style="margin-bottom: 5px; border-bottom:solid 1px #dddddd;">
            <if condition="equal_permission_name('新增语音菜单',$loginData['role_id'])">
                <a href="{:AddonU('MusicMenu/item_edit')}" class="easyui-linkbutton lnk_grid_add" iconCls="icon-add" plain="true">新增</a>
            </if>
            <if condition="equal_permission_name('编辑语音菜单',$loginData['role_id'])">
                <a href="{:AddonU('MusicMenu/item_edit','show=dialog&id='.$vo['id'])}" class="easyui-linkbutton lnk_grid_edit" iconCls="icon-edit" plain="true">编辑</a>
            </if>
            <if condition="equal_permission_name('删除语音菜单',$loginData['role_id'])">
                <a href="{:AddonU('MusicMenu/item_delete','id=varid')}" class="easyui-linkbutton lnk_grid_remove" iconCls="icon-remove" plain="true" data-success-fn="show_reload_tip">删除</a>
            </if>
            <a href="#" class="easyui-linkbutton lnk_grid_search" iconCls="icon-search" plain="true">搜索</a>
        </div>
    </div>
    <!--隐藏区域-->
    <div style="display:none">
        <!--表格查询对话框-->
        <div id="dlg_search" style="padding:10px">
            <form method="get" action="{:AddonU('MusicMenu/get_musicmenu_list_json')}">
                <if condition="$isSuperAdmin">
                    租户：<input type="text" name="siteID" id="siteID" class="easyui-combobox" data-url="{:AddonU('Admin/get_admin_json')}" />
                    <else/>
                    <input type="hidden" name="siteID" value="{$loginData.siteID}"/>
                </if>
            </form>
        </div>
        <!--/表格查询对话框-->
    </div>
    <!--/隐藏区域-->
</block>
<block name="body_after_block">
    <script type="text/javascript">
        // 页面初始化
        var curd_grid = CurdGrid.newInstance();
        curd_grid.before_search_dialog = function () {
            $('#siteID').combobox({url: $('#siteID').data('url'), valueField: 'id', textField: 'text'});
        }
        curd_grid.config({
            title: '语音菜单管理',
            toolbar: '#tb',
            columns: [[
                    {field: 'ck', checkbox: true},
                    {title: "租户ID", field: "siteIDText", sortable: true},
                    {title: "菜单编号", field: "id", sortable: true},
                    {title: "放音文件", field: "musicText", sortable: true},
                    {title: "放音次数", field: "musicLimit", sortable: true},
                    {title: "导航动作", field: "outOperText", sortable: true},
                    {title: "动作参数", field: "outParamText", sortable: true},
                    {title: "评价", field: "outEcEnableText", sortable: true},
                    {title: "备注", field: "remark", sortable: true},
                    {title: "试听", field: "listenPath", formatter: function (value, row) {
                            return '<div class="soplayer"><span class="playermask"><audio src="' + value + '" controls="controls">您的浏览器不支持播放器插件,请升级到IE10以上的浏览器版本或火狐、谷歌等现代浏览器</audio></span><i style="clearfix"></i></div>';
                        }},
                    {title: '操作', field: "downloadPath", formatter: function (value, row) {
                            return '<a href="' + value + '" target="_blank" class="easyui-linkbutton">下载</a>';
                        }},
                ]],
        });
        curd_grid.init();
    </script>
</block>